#include <iostream>
#include <stack>
#include <string>
#include <locale>
using namespace std;

int main()
{
    stack<int> s;
    char in;
    while (cin >> in)
    {
        int fir = 0, sec = 0;
        if (isdigit(in))
        {
            string num; num.push_back(in);
            while (cin >> in && in != '.')
            {
                num.push_back(in);
            }
            s.push(stoi(num));
        }
        else if (in == '+')
        {
            sec = s.top(); s.pop();
            fir = s.top(); s.pop();
            s.push(fir + sec);
        }
        else if (in == '-')
        {
            sec = s.top(); s.pop();
            fir = s.top(); s.pop();
            s.push(fir - sec);
        }
        else if (in == '*')
        {
            sec = s.top(); s.pop();
            fir = s.top(); s.pop();
            s.push(fir * sec);
        }
        else if (in == '/')
        {
            sec = s.top(); s.pop();
            fir = s.top(); s.pop();
            s.push(fir / sec);
        }
        else if (in == '@')
        {
            cout << s.top();
            break;
        }
    }
    return 0;
}
/*
3.5.2.-*7.+@

16
*/
